/**
 * Created by Administrator on 2017/4/21.
 */
function init() {
    $("#i1").val("post");
}
function geth() {
    var method = $("#i1").val();
    var header = $("#i2").val();
    var body = $("#i3").val();
    var url = $("#iu").val();
    var result;
    var body ={
    		"method":method,
    		"header":method,
    		"body":method,
    		"url":method
    }
    //http://localhost:8980/wxx_sm/wxx/c11?name=weixx
    $.ajax({
        url: "http://localhost:8980/wxx_sm"+url,
        type: method,
        async: false,
        dataType: "json",
        contentType: "application/json",
        data: body,
        beforeSend: function (request) {
            request.setRequestHeader("clentid", "151");
            request.setRequestHeader("userid", "123");
            request.setRequestHeader("acton", "8uhb*IK<");
            request.setRequestHeader("chnflg", "sjyh");
            request.setRequestHeader("clientType", "html5");
        },
        success: function (data) {
        	result=data;
            alert(">>>>>>>>>>>>>>" + JSON.stringify(data));
            if (!data) {
                alert('success!');
            } else {
                alert(">>>>>>>>>>>>>>" + JSON.stringify(data));
            }
        },
        error: function (data) {
        	result=data;
        	alert(">>result>>" + JSON.stringify(data));
            if (!data) {
                alert('success!');
            }
        }
    })
    return result;
}

function clickEvn() {
    var result =geth();
    console.log(">>>>>>>>>>>>>>"+result.responseText);
    $("#i4").val(result.responseText);
    
    //this.window.open("./static/html/win.html","info","width=270,height=200");
    //$("#win").val(result.responseText);
}
